﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Data;

namespace IntelligentCMS
{
    public class CMSDataLayer
    {
        public static void CreateNewUser(string Username, string Password, string Email, string SecurityQuestion, string SecurityAnswer, string Homepage)
        {
            CMSDataLayerMSSQL.CreateNewUser(Username, Password, Email, SecurityQuestion, SecurityAnswer, Homepage);
            //todo: add support for other data layer implementations other than ms sql. would be done with a variable storing
            //the type of data layer used at the moment and either if-then blocks here or an object setup where data layer
            //would be an abstract class that individual data layers would implement
        }

        public static List<string> GetAllTags()
        {
            return CMSDataLayerMSSQL.GetAllTags();
        }

        public static DataTable GetHomepageUserIDFromUsername(string Username)
        {
            return CMSDataLayerMSSQL.GetHomepageUserIDFromUsername(Username);
        }

        public static DataTable GetUsernameFromUserID(long userid)
        {
            return CMSDataLayerMSSQL.GetUsernameFromUserID(userid);
        }

        public static DataTable GetHomepageUserIDFromUsernamePassword(string Username, string Password)
        {
            return CMSDataLayerMSSQL.GetHomepageUserIDFromUsernamePassword(Username, Password);
        }

        public static DataTable GetFilenameFromField(string type)
        {
            return CMSDataLayerMSSQL.GetFilenameFromField(type);
        }

        public static DataTable GetAllFields()
        {
            return CMSDataLayerMSSQL.GetAllFields();
        }

        public static void UpdateProfile(long userid, string firstname, string lastname, string address, string city, string state, string zip, string country, string cellphone, string workphone, string homephone)
        {
            CMSDataLayerMSSQL.UpdateProfile(userid, firstname, lastname, address, city, state, zip, country, cellphone, workphone, homephone);
        }

        public static DataTable GetProfile(long userid)
        {
            return CMSDataLayerMSSQL.GetProfile(userid);
        }
    }
}
